package ThreadDemo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 阿宾
 * Date: 2025-03-20
 * Time: 21:35
 */
public class ThreadDemo16 {
    public static void main(String[] args) {
        Thread t1 = new Thread(
                ()->{
                    Thread thread = Thread.currentThread();//获取当前线程的实例
                    System.out.println(thread.getId()+","+thread.getName());
                }
        );
        Thread t2 = new Thread(
                ()->{
                    Thread thread = Thread.currentThread();//获取当前线程的实例
                    System.out.println(thread.getId()+","+thread.getName());
                }
        );

        t1.start();
        t2.start();
    }
}
